package caixinyu.demo77777.service;

import caixinyu.demo77777.dao.CustomerDao;
import caixinyu.demo77777.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements  CustomerServcie{
    @Autowired
    CustomerDao customerDao;

    //添加客户信息
    public int saveCustomer(Customer customer) {
        return customerDao.saveCustomer(customer);
    }

    //根据ID查询客户信息
    public Customer getCustomerById(Integer id) {
        return customerDao.getCustomerById(id);
    }


    //获取所有角色信息
    public List<Customer> getAllCustomer(){
        return customerDao.getAllCustomer();
    }

    //修改角色信息
    public int updateCustomer(Customer customer){
        return customerDao.updateCustomer(customer);
    }

    //根据ID删除角色信息
    public int deleteCustomerById(Integer id){
        return customerDao.deleteCustomerById(id);
    }

}
